﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PatternTemplateMethod
{
    class Program
    {
        static void Main(string[] args)
        {
            Cooking dish = new Dish1(); 

            dish.Cook();

            dish = new Dish2();

            dish.Cook();

        }
    }


    abstract class Cooking
    {
        protected   abstract void Step1();
        protected abstract void Step2();  
        public void Cook()
        {
            Step1();
            Step2(); 
        } 
    }

    class Dish1 : Cooking
    {
        protected override void Step1()
        {
            Console.WriteLine("cut");
        }

        protected override void Step2()
        {
            Console.WriteLine("out");
        }
    }

    class Dish2 : Cooking
    {
        protected override void Step1()
        {
            Console.WriteLine("fire");
        }

        protected override void Step2()
        {
            Console.WriteLine("cold");
        }
    }
}
